package iTw3etPackage;


import javax.swing.JFrame;
import javax.swing.JLabel;

/* Needed for twitter */
import twitter4j.Status;
import twitter4j.Twitter;
import twitter4j.TwitterException;
import twitter4j.TwitterFactory;
import twitter4j.http.AccessToken;

public class MyITw3et extends JFrame {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	/**
	 * @param args
	 */
	@SuppressWarnings("deprecation")
	public static void main(String[] args) 
	{
		new MyITw3et();
		
		/* 
		 * The factory instance is re-usable and thread safe. 
		 * 
		 * 215323632
	token : 215323632-jKvI6qx70DRIHwfGqAViEI57XgykPWOI0bfI2BI4
tokenSecret : hrQfEo4K9Pj9ScKJlJ0b3YjeHaG5esrARiQV9bWucs

*/

	    
	        
	    
		
		Twitter twitter;  
		twitter = new TwitterFactory().getInstance();
		
		String consumerKey="RApzCm90kUCP8H8KrKQBSA";
		String consumerSecret="7cENVzaiI5ETrbiY2hlhxj86llMGojjVC10BqEQQdRI";
		String twitterToken="215323632-jKvI6qx70DRIHwfGqAViEI57XgykPWOI0bfI2BI4";
		String twitterTokenSecret="hrQfEo4K9Pj9ScKJlJ0b3YjeHaG5esrARiQV9bWucs";
		
		twitter.setOAuthConsumer(consumerKey, consumerSecret);
		
		
		AccessToken accessToken = new AccessToken(twitterToken, twitterTokenSecret);
		twitter.setOAuthAccessToken(accessToken);
		
		String latestStatus = "Another message before heading to applet interface integration";
		Status status;
		try {
			status = twitter.updateStatus(latestStatus);
			System.out.println("Successfully updated the status to [" + status.getText() + "].");
		} catch (TwitterException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	    
		
	}
	

		
	private MyITw3et() 
		{
				JLabel jlbHelloWorld = new JLabel("Hello World");
				add(jlbHelloWorld);
				this.setSize(500, 500);
				// pack();
				setVisible(true);

		}

	

}
